package com.hsgene.order.service.api.impl;

import com.hsgene.common.util.exception.CommonErrorCode;
import com.hsgene.common.util.result.ApiResult;
import com.hsgene.order.service.api.ProductService;
import com.hsgene.product.domain.GeneticTestingPackage;
import com.hsgene.product.dto.peanut.GeneticTestingPackageDetilPeanutDto;
import com.hsgene.product.dto.peanut.GeneticTestingProductDetailDto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 基因检测套餐查询fallback
 *
 * @author wangbing
 * @version 1.0, 2018/9/25
 */
@Component
public class ProductServiceImpl implements ProductService {

    private final static Logger LOGGER = LoggerFactory.getLogger(ProductServiceImpl.class);

    @Override
    public ApiResult<GeneticTestingPackage> getPackageById(String id, Integer platform) {
        LOGGER.error("基因检测套餐服务不可用！");
        return ApiResult.fail(CommonErrorCode.PRODUCT_SERVICE_NOT_AVAILABLE);
    }

    @Override
    public ApiResult updateProduct(GeneticTestingPackage geneticTestingPackage) {
        LOGGER.error("套餐被用标记失败！");
        return ApiResult.fail(CommonErrorCode.PRODUCT_SERVICE_NOT_AVAILABLE);
    }

    @Override
    public ApiResult tagPackage(List<String> ids) {
        LOGGER.error("批量标记套餐被用失败！");
        return ApiResult.fail(CommonErrorCode.PRODUCT_SERVICE_NOT_AVAILABLE);
    }

    @Override
    public ApiResult<GeneticTestingProductDetailDto> packageTestingInfo(String packageId, String agencyId) {
        LOGGER.error("查询套餐下的机构失败,套餐id{}，机构id{}！", packageId, agencyId);
        return ApiResult.fail(CommonErrorCode.PRODUCT_SERVICE_NOT_AVAILABLE);
    }

    @Override
    public ApiResult<List<GeneticTestingPackageDetilPeanutDto>> getDetailsByPackageId(String id) {
        LOGGER.error("查找套餐对应检测方式失败，套餐id{}", id);
        return ApiResult.fail(CommonErrorCode.PRODUCT_SERVICE_NOT_AVAILABLE);
    }
}
